#!/bin/sh
# Job yaml can send below ENVIRONMENT VARIABLES to me
# - modes
# - period
# END ENVIRONMENT VARIABLES

## tcrypt.ko module purpose is to test different crypto algorithm from the kenrel space.

for i in $(seq ${modes%-*} ${modes#*-})
do
	# tcrypt do testing by modules inserting, then exit from kernel
	log_cmd /sbin/modprobe tcrypt sec=$period mode=$i
done

# to silence the "expected" failure explicitly:
#    modprobe: ERROR: could not insert 'tcrypt': Resource temporarily unavailable

log_cmd dmesg | grep -Ee "tcrypt:|/sbin/modprobe tcrypt|testing speed of|operations in|opers/sec|bytes/sec"
